{extend name="base/base" /}
{block name="content"}

<div class="layui-form-item layui-form-pane">

      <div class="layui-inline">
          <label class="layui-form-label">用户ID</label>
          <div class="layui-input-inline">
              <input type="text" name="userid" autocomplete="off" class="layui-input" id='userid' value="{$userid ?: ''}">
          </div>
      </div>
      <div class="layui-inline">
          <label class="layui-form-label">团队ID</label>
          <div class="layui-input-inline">
              <input type="text" name="pid" autocomplete="off" class="layui-input" id='pid' value="{$pid ?:''}">
          </div>
      </div>
      <div class="layui-inline">
          <label class="layui-form-label">时间</label>
          <div class="layui-input-inline">
              <input type="text" class="layui-input" name="start_time" id="start_time" placeholder="yyyy-MM-dd" value="{$start_time ?: ''}">
          </div>
          <div class="layui-form-mid">-</div>
          <div class="layui-input-inline">
              <input type="text" class="layui-input" name="end_time" id="end_time" placeholder="yyyy-MM-dd" value="{$end_time ?: ''}">
          </div>
      </div>
      <div class="layui-inline">
        <div class="demoTable">
          <button class="layui-btn" data-type="reload" onclick="check()">搜索</button>
          <!-- <button class="layui-btn" onclick="excel()">导出表</button> -->
        </div>
      </div>
</div>

<h>注册统计:</h>
<table class="layui-table">
    <colgroup>
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <!-- <col width="200"> -->
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>总注册人数</th>
        <th>昨日注册人数</th>
        <th>今日注册人数</th>
        <th>三日注册人数</th>
        <th>本周注册人数</th>
        <th>本月注册人数</th>
        <th>{$start_time} 至 {$end_time}</th>
      </tr> 
    </thead>
    <tbody>
        <tr>
          <td>{$reg.total}</td>
          <td>{$reg.yes}</td>
          <td>{$reg.today}</td>
          <td>{$reg.three}</td>
          <td>{$reg.week}</td>
          <td>{$reg.month}</td>
          <td>{$reg.time}</td>
        </tr>
    </tbody>
</table>
<br />
<h>充值统计（充值已进入app）:</h>
<table class="layui-table">
    <colgroup>
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <!-- <col width="200"> -->
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>总充值</th>
        <th>昨日充值</th>
        <th>今日充值</th>
        <th>三日充值</th>
        <th>本周充值</th>
        <th>本月充值</th>
        <th>{$start_time} 至 {$end_time}</th>
      </tr> 
    </thead>
    <tbody>
        <tr>
          <td>{$into.total}</td>
          <td>{$into.yes}</td>
          <td>{$into.today}</td>
          <td>{$into.three}</td>
          <td>{$into.week}</td>
          <td>{$into.month}</td>
          <td>{$into.time}</td>
        </tr>
    </tbody>
</table>
<br />

<h>提币统计（按申请时间且已通过审核）:</h>
<table class="layui-table">
    <colgroup>
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <!-- <col width="200"> -->
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>总提币</th>
        <th>昨日提币</th>
        <th>今日提币</th>
        <th>三日提币</th>
        <th>本周提币</th>
        <th>本月提币</th>
        <th>{$start_time} 至 {$end_time}</th>
      </tr> 
    </thead>
    <tbody>
        <tr>
          <td>{$out.total}</td>
          <td>{$out.yes}</td>
          <td>{$out.today}</td>
          <td>{$out.three}</td>
          <td>{$out.week}</td>
          <td>{$out.month}</td>
          <td>{$out.time}</td>
        </tr>
    </tbody>
</table>
<br />
<h>提币统计（待审核）:</h>
<table class="layui-table">
    <colgroup>
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <!-- <col width="200"> -->
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>总提币</th>
        <th>昨日提币</th>
        <th>今日提币</th>
        <th>三日提币</th>
        <th>本周提币</th>
        <th>本月提币</th>
        <th>{$start_time} 至 {$end_time}</th>
      </tr> 
    </thead>
    <tbody>
        <tr>
          <td>{$out2.total}</td>
          <td>{$out2.yes}</td>
          <td>{$out2.today}</td>
          <td>{$out2.three}</td>
          <td>{$out2.week}</td>
          <td>{$out2.month}</td>
          <td>{$out2.time}</td>
        </tr>
    </tbody>
</table>
<br />
<h>等级统计：</h>
<table class="layui-table">
    <colgroup>
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>等级名称</th>
        <th>总人数</th>
        <th>昨日新增</th>
        <th>今日新增</th>
        <th>三日新增</th>
        <th>本周新增</th>
        <th>本月新增</th>
        <th>{$start_time} 至 {$end_time}</th>
      </tr> 
    </thead>
    <tbody>
      {foreach $level as $vo} 
        <tr>
          <td>{$vo.name}</td>
          <td>{$vo.total}</td>
          <td>{$vo.yes}</td>
          <td>{$vo.today}</td>
          <td>{$vo.three}</td>
          <td>{$vo.week}</td>
          <td>{$vo.month}</td>
          <td>{$vo.time}</td>
        </tr>
      {/foreach}
    </tbody>
</table>
<br />
<h>智能云统计（按下单时间）：</h>
<table class="layui-table">
    <colgroup>
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>智能云名称</th>
        <th>总台数</th>
        <th>昨日新增</th>
        <th>今日新增</th>
        <th>三日新增</th>
        <th>本周新增</th>
        <th>本月新增</th>
        <th>{$start_time} 至 {$end_time}</th>
      </tr> 
    </thead>
    <tbody>
      {foreach $robot as $vo} 
        <tr>
          <td>{$vo.name}</td>
          <td>{$vo.total}</td>
          <td>{$vo.yes}</td>
          <td>{$vo.today}</td>
          <td>{$vo.three}</td>
          <td>{$vo.week}</td>
          <td>{$vo.month}</td>
          <td>{$vo.time}</td>
        </tr>
      {/foreach}
    </tbody>
</table>
<br />
<h>智能云收益发放统计：</h>
<table class="layui-table">
    <colgroup>
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col width="200">
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>收益发放名称</th>
        <th>总收益</th>
        <th>昨日收益</th>
        <th>今日收益</th>
        <th>三日收益</th>
        <th>本周收益</th>
        <th>本月收益</th>
        <th>{$start_time} 至 {$end_time}</th>
      </tr> 
    </thead>
    <tbody>
      {foreach $profit as $vo} 
        <tr>
          <td>{$vo.name}发放</td>
          <td>{$vo.total}</td>
          <td>{$vo.yes}</td>
          <td>{$vo.today}</td>
          <td>{$vo.three}</td>
          <td>{$vo.week}</td>
          <td>{$vo.month}</td>
          <td>{$vo.time}</td>
        </tr>
      {/foreach}
    </tbody>
</table>
<br />
{/block}
{block name="script"}
<script>
  layui.use(['table', 'laydate'], function(){
    var laydate = layui.laydate;
  laydate.render({
    elem: '#start_time'
  });
  laydate.render({
    elem: '#end_time'
  });
});

  function check(){
    var userid = $('#userid').val();
    var pid = $('#pid').val();
    var start_time = $('#start_time').val();
    var end_time = $('#end_time').val();

    $.ajax({
            url:"{:url('admin/total/totalCheck')}",
            type:"POST",
            data:{userid:userid,pid:pid},
            success:function(ret){
                if (ret.code == 0) {
                  window.location.href = "/admin/total/total?userid="+userid+"&pid="+pid+"&start_time="+start_time+"&end_time="+end_time;
                  // layer.msg('操作成功');
                  // $(".layui-laypage-btn")[0].click();
                }
                if (ret.code == 1) {
                    layer.msg(ret.msg);
                }
            }
          });
  }
</script>
{/block}
